package com.qf.controller;

import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {

    @RequiresPermissions(value = {"sys:user:add", "sys:user:update"}, logical = Logical.AND)
    @RequestMapping("/test")
    public String test(){
        System.out.println("拥有 用户添加和更新权限");
        return "success";
    }


    @RequiresRoles(value = {"开发工程师"})
    @RequestMapping("/test1")
    public String test1(){
        System.out.println("拥有开发工程师角色");
        return "success";
    }

}
